<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        .red{
            background-color: red;
        }
    </style>
</head>
<body>
<div id="l1">
    123
</div>
<input type="button" onclick="edit();" value="变红">
<input type="button" onmousemove="rollback();" value="不变">

<script type="text/javascript">
    function edit(){
        var i= document.getElementById("l1")
        i.className = "red"
    }
    function rollback(){
        var i=document.getElementById("l1")
        i.className = ""
    }
</script>
</body>
</html>